package com.karst.webnotes.chapter02
{
	import flash.events.Event;
	
	import org.aswing.AsWingManager;
	import org.papervision3d.objects.primitives.Sphere;
	import org.papervision3d.view.BasicView;
	
	internal class BasicViewExample extends BasicView
	{
		
		public function BasicViewExample()
		{
			super() ;
			setStage() ;
			createView() ;
			startRendering() ;
		}

		private function setStage() : void
		{
			AsWingManager.getStage().frameRate = 40 ;  //设置帧频
		}

		private var sphere : Sphere = null ;
		private function createView() : void
		{
			if( sphere == null )
				sphere = new Sphere() ;
			scene.addChild( sphere ) ;
		}
		
		override protected function onRenderTick( event : Event = null ) : void
		{
			if( sphere )
				sphere.localRotationX += 1 ;
			super.onRenderTick() ;
		}
	}
}